<html>
	<head>
		<script type="text/javascript" src="javascript/jquery-ui-1.8.10.custom.min.js"></script>
		<script type = "text/javascript">
			function uploadFile() {
				alert("Before submitting");
				jQuery("#uploadFileForm").submit();
				alert("After submitting");
			}
		</script>
	</head>
	<body>
		<form action = "fileUpload.action" id = "uploadFileForm" method = "POST" enctype = "multipart/form-data" onsubmit="uploadFile()">
			<input type = "file" name = "upload"><br/>
			<input type = "submit" value = "Upload file">
		</form>
	</body>
</html>